<?php
require_once '../config.php';
require_once '../db/put/user.php';
require_once '../util/redirect.php';

handleRegister();

function handleRegister() {

  if( is_string($_POST['user']) && is_string($_POST['pass']) 
      && is_string( $_POST['email'] ) ) {

   if( $_POST['captcha'] != $_SESSION['captcha'] ) 
     echo 'BREAKAGE';

    $suc = addUser( $_POST['user'], hash('sha512', (string)($_POST['pass'])), (string)($_POST['email']) );
  } 

  //if( $suc ) 
    sendto('../view/fora.php');
}

?>
